/*
 * 
 * entity对象基础类
 */
package com.chinacache.maint.commons.entity;

import java.util.HashMap;
import java.util.Map;

import javax.persistence.Transient;

/**
 * @author Administrator
 * 
 * POJO对象基础类
 */
@SuppressWarnings("serial")
public class BaseEntity implements java.io.Serializable {
	@Transient
	public static final int FIELD_TYPE_TEXT = 1;
	@Transient
	public static final int FIELD_TYPE_CHECKBOX = 2;
	@Transient
	public static final int FIELD_TYPE_RADIO = 3;
	@Transient
	public static final int FLOW_START = 1;
	@Transient
	public static final int FLOW_EXECUTE = 2;
	@Transient
	public static final int FLOW_END = 3;
	@Transient
	public static final int IS_MUST_INPUT_YES = 1;
	@Transient
	public static final int IS_MUST_INPUT_NO = 2;

	@Transient
	public static final int FLOW_STATUS_START = 1;
	@Transient
	public static final int FLOW_STATUS_PRO = 2;
	@Transient
	public static final int FLOW_STATUS_END = 3;

	@Transient
	public static final int AUDIT_YES = 1;
	@Transient
	public static final int AUDIT_NO = 2;

	@Transient
	public static final int MODIFY_NO = 1;
	@Transient
	public static final int MODIFY_YES = 2;
	/**
	 * 扩展属性集合对象
	 */
	@Transient
	private Map<String, Object> extendAttributes = new HashMap<String, Object>();

	/**
	 * 提交模板扩展属性
	 * 
	 * @param attributeName
	 *            String 属性名称
	 * @param attributeValue
	 *            Object 属性值对象
	 */
	public void putExtendAttribute(String attributeName, Object attributeValue) {
		extendAttributes.put(attributeName, attributeValue);
	}

	public Map<String, Object> getExtendAttributes() {
		return extendAttributes;
	}

	public void setExtendAttributes(Map<String, Object> extendAttributes) {
		this.extendAttributes = extendAttributes;
	}

	/**
	 * 得到指定名称的扩展属性值对象
	 * 
	 * @param attributeName
	 *            String 属性名称
	 * @return Object 扩展属性值对象
	 */
	public Object getExtendAttribute(String attributeName) {
		return extendAttributes.get(attributeName);
	}

	/**
	 * 清空所有扩展属性
	 */
	public void clearExtendAttributes() {
		extendAttributes.clear();
	}

	public static int getFIELD_TYPE_TEXT() {
		return FIELD_TYPE_TEXT;
	}

	public static int getFIELD_TYPE_CHECKBOX() {
		return FIELD_TYPE_CHECKBOX;
	}

	public static int getFIELD_TYPE_RADIO() {
		return FIELD_TYPE_RADIO;
	}

	public static int getFLOW_START() {
		return FLOW_START;
	}

	public static int getFLOW_EXECUTE() {
		return FLOW_EXECUTE;
	}

	public static int getFLOW_END() {
		return FLOW_END;
	}

	public static int getIS_MUST_INPUT_YES() {
		return IS_MUST_INPUT_YES;
	}

	public static int getIS_MUST_INPUT_NO() {
		return IS_MUST_INPUT_NO;
	}

	public static int getFLOW_STATUS_START() {
		return FLOW_STATUS_START;
	}

	public static int getFLOW_STATUS_PRO() {
		return FLOW_STATUS_PRO;
	}

	public static int getFLOW_STATUS_END() {
		return FLOW_STATUS_END;
	}

	public static int getAUDIT_YES() {
		return AUDIT_YES;
	}

	public static int getAUDIT_NO() {
		return AUDIT_NO;
	}

	public static int getMODIFY_YES() {
		return MODIFY_YES;
	}

	public static int getMODIFY_NO() {
		return MODIFY_NO;
	}

}
